import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

// 路由配置项
export default new Router({
  routes: [{
    path: '/',
    name: 'Home',
    component: () => import('@/pages/home/home.vue')
  },
  {
    path: '/city',
    name: 'City',
    component: () => import('@/pages/city/city.vue')
  },
  {
    path: '/detail/:id',
    name: 'Detail',
    component: () => import('@/pages/detail/detail.vue')
  }],
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})
